/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package film.modeles.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author MAZID
 */
@Embeddable
public class CommentairePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "idFilm", nullable = false)
    private int idFilm;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "loginCl", nullable = false, length = 10)
    private String loginCl;

    public CommentairePK() {
    }

    public CommentairePK(int idFilm, String loginCl) {
        this.idFilm = idFilm;
        this.loginCl = loginCl;
    }

    public int getIdFilm() {
        return idFilm;
    }

    public void setIdFilm(int idFilm) {
        this.idFilm = idFilm;
    }

    public String getLoginCl() {
        return loginCl;
    }

    public void setLoginCl(String loginCl) {
        this.loginCl = loginCl;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idFilm;
        hash += (loginCl != null ? loginCl.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CommentairePK)) {
            return false;
        }
        CommentairePK other = (CommentairePK) object;
        if (this.idFilm != other.idFilm) {
            return false;
        }
        if ((this.loginCl == null && other.loginCl != null) || (this.loginCl != null && !this.loginCl.equals(other.loginCl))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "film.modeles.entity.CommentairePK[ idFilm=" + idFilm + ", loginCl=" + loginCl + " ]";
    }
    
}
